!!!
%html
  %head
    %meta{:charset => 'utf-8'}/
    = favicon_link_tag 'favicon.ico'

    = stylesheet_link_tag 'application', :media => 'all'
    = stylesheet_link_tag 'print', :media => 'print'
    = engine_stylesheet_link_tag :media => 'screen, projection, print'
    = javascript_include_tag "application"

    = csrf_meta_tag
    %title
      - if current_user
        = "#{current_user.tenant}: #{content_for :page_title} - #{Settings.title}"
      - else
        = "#{content_for :page_title} - #{Settings.title}"

  %body
    .navbar.navbar-fixed-top
      .navbar-inner
        .container-fluid
          = link_to root_path, :class => 'brand' do
            = Settings.title

          - if user_signed_in?
            = render_navigation(:context => :main, :level => 1..2, :renderer => SimpleNavigation::Renderer::BootstrapTopbarList, :expand_all => true)
            = render_navigation(:context => :user, :level => 1..2, :renderer => SimpleNavigation::Renderer::BootstrapTopbarList, :expand_all => true)
            = form_tag search_path, :method => :get, :class => "navbar-search pull-left" do
              = text_field_tag "query", params[:query], :placeholder => t('placeholder.search'), :class => "search-query"
          .brand(style="margin-left: 1em")
            = current_tenant.to_s if user_signed_in?
          %ul.nav.pull-right
            - if user_signed_in?
              %li= render 'fiscal_year_filter'
              %li= render 'users/user_bar'

    #content.container-fluid
      - if notice
        = boot_alert(notice, 'success')
      - if alert
        = boot_alert(alert, 'error')
      .row-fluid
        - if user_signed_in?
          #sidebar.span2
            = render 'application/sidebar'
            .sidebar= render_sidebars
          .span10
            .content
              = yield
        - else
          .offset3.span6= yield

    #footer
      .container-fluid
        %p.pull-right
          = link_to t('application.imprint'), imprint_path
          = link_to "Deutsch", :locale => 'de-CH'
          = link_to "English", :locale => 'en'
        %p= raw Settings.footer
